import math
from shapely import affinity
from shapely import geometry


def make_circle(center, radius=10, res=30):
    points = []
    for i in range(res):
        ang = 2 * math.pi * i / res
        points.append((math.cos(ang) * radius, math.sin(ang) * radius))
    geom = geometry.Polygon(points)
    geom = affinity.translate(geom, center[0], center[1])
    return geom


def make_polygon_with_lw(center, length, width, radian=0):
    x, y = center[0], center[1]
    l, r, t, b = x - length / 2, x + length / 2, y + width / 2, y - width / 2
    res = geometry.Polygon([(l, b), (l, t), (r, t), (r, b)])
    if radian != 0:
        res = affinity.rotate(res, radian, origin='center', use_radians=True)
    return res


geom = geometry.Point(1,1)
geom = affinity.translate(geom, 3, 3)
print(geom)
